import asunit.framework.TestCase;
import com.lbi.framework.mvc.collection.Searchable;
import com.lbi.framework.mvc.collection.ISearchable;

/**
 * @author michaelforrest
 */
class framework.collection.SearchableTest extends TestCase {
	private var className : String = "SearchableTest";

	private var collection : Searchable = new Searchable([{val:1},{val:2},{val:3},{val:4}]);
	
	public function SearchableTest(testMethod : String) {
		super(testMethod);
	}
	private function testWithObjects() :Void{
		var expected : Number = 2;
		var result : Object = collection.findByProperty("val",expected);
		assertEquals("didn't find " + expected + " in " + result, expected, result.val);
	}
	private function testReturnsNullIfNoResult() :Void{
		var result : Object = collection.findByProperty("val", "donkey");
		assertNull(result);	
	}
}